package com.ganzalang.gmall.designpatterns.facade;

import lombok.extern.slf4j.Slf4j;

/**
 * @description: 不使用外观模式
 * @author: ganzalang
 */
@Slf4j
public class WithoutFacadePatternDemo {

    public static void main(String[] args) {
        ServiceA serviceA = new ServiceAImpl();
        ServiceB serviceB = new ServiceBImpl();
        ServiceC serviceC = new ServiceCImpl();
        serviceA.execute();
        serviceB.execute();
        serviceC.execute();
    }

    public interface ServiceA {
        void execute();
    }

    public interface ServiceB {
        void execute();
    }

    public interface ServiceC {
        void execute();
    }

    public static class ServiceAImpl implements ServiceA {

        @Override
        public void execute() {
            log.info("执行A模块");
        }
    }

    public static class ServiceBImpl implements ServiceB {

        @Override
        public void execute() {
            log.info("执行B模块");
        }
    }

    public static class ServiceCImpl implements ServiceC {

        @Override
        public void execute() {
            log.info("执行C模块");
        }
    }


}
